package cn.anecansaitin.industrialization_expansion.client.integration.jei;

import cn.anecansaitin.industrialization_expansion.common.item.crafting.ModifiedToolRecipe;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.category.extensions.vanilla.crafting.ICraftingCategoryExtension;
import net.minecraft.util.ResourceLocation;

import javax.annotation.Nullable;
public class ModCraftingCategoryExtension implements ICraftingCategoryExtension {
    private final ModifiedToolRecipe recipe;

    public ModCraftingCategoryExtension(ModifiedToolRecipe recipe) {
        this.recipe = recipe;
    }

    @Override
    public void setIngredients(IIngredients ingredients) {
        ingredients.setInputs(VanillaTypes.ITEM, recipe.getTemplates());
        ingredients.setOutput(VanillaTypes.ITEM, recipe.getResultItem());
    }

    @Nullable
    @Override
    public ResourceLocation getRegistryName() {
        return recipe.getId();
    }
}
